﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WorkStoryPage.aspx.cs" Inherits="ZhaoPin.Feature.WorkStoryPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    <style type="text/css">
        .Grid
        {
            border: solid 1px #93c2f1;
            width: 98%;
            font-size: 11pt;
        }
        .Grid td
        {
            border-collapse: collapse;
            border: solid 1px #93c2f1;
            font-size: 11pt;
        }
        .Grid th
        {
            border-collapse: collapse;
            border: solid 1px #93c2f1;
            font-size: 11pt;
            background-color: #e4f6ff;
        }
        .err
        {
            color: Red;
        }
    </style>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager" runat="server" EnableScriptGlobalization="true"
        EnableScriptLocalization="true">
    </ajaxToolkit:ToolkitScriptManager>
    <div align="center" style="width: 760px; font-size: 12pt; font-family: 新宋体;">
        <table border="1px" cellpadding="3px" cellspacing="0" width="760px">
            <tr>
                <td colspan="5">
                    填写简历格式样例</td>
            </tr>
            <tr>
                <td>
                    起止日期
                </td>
                <td>
                    单位名称
                </td>
                <td>
                    医院等级</td>
                <td>
                    岗位名称
                </td>
                <td>
                    聘任职称</td>
            </tr>
            <tr>
                <td>
                    自2007年7月<br />
                    至2010年8月
                </td>
                <td>
                    青医附院
                </td>
                <td>
                    三级甲等</td>
                <td>
                    呼吸内科医师</td>
                <td>
                    医师</td>
            </tr>
            <tr>
                <td>
                    自2010年8月<br />
                    至2012年9月
                </td>
                <td>
                    青医附院</td>
                <td>
                    三级甲等</td>
                <td>
                    呼吸内科医师</td>
                <td>
                    主治医师</td>
            </tr>
        </table>
        <div style="padding-top: 10px; padding-bottom: 10px">
            工作经历（实习进修经历请勿填写）</div>
        <asp:GridView ID="gvWorkStory" runat="server" AutoGenerateColumns="False" Font-Size="15px"
            Width="760px" EmptyDataText="请添加工作经历" ShowHeaderWhenEmpty="True" CssClass="Grid"
            OnRowCommand="gvWorkStory_RowCommand" DataSourceID="gvWorkStory_EntityDataSource"
            DataKeyNames="Id" OnRowDataBound="gvWorkStory_RowDataBound" 
            OnRowEditing="gvWorkStory_RowEditing" EnableViewState="False">
            <Columns>
                <asp:TemplateField ShowHeader="False">
                    <HeaderTemplate>
                        <asp:LinkButton ID="btnInsert" runat="server" CausesValidation="False" CommandName="Insert"
                            Text="新增"></asp:LinkButton>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:LinkButton ID="btnEdit" runat="server" CausesValidation="False" CommandName="Edit"
                            Text="编辑"></asp:LinkButton>
                        <asp:LinkButton ID="btnDelete" runat="server" CausesValidation="False" CommandName="Delete"
                            Text="删除"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField HeaderText="自" DataField="StartDate" DataFormatString="{0:Y}" />
                <asp:BoundField HeaderText="至" DataField="EndDate" DataFormatString="{0:Y}" />
                <asp:BoundField HeaderText="单位名称" DataField="Company" />
                <asp:TemplateField HeaderText="医院等级">
                    <ItemTemplate>
                        <asp:Label ID="lbHospitalClass" runat="server" Text='<%# Eval("TDictHospitalClass.FName") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField HeaderText="岗位名称" DataField="Post" />
                 <asp:BoundField HeaderText="聘任职称" DataField="ProfessionalRank" />
            </Columns>
        </asp:GridView>
        <asp:EntityDataSource ID="gvWorkStory_EntityDataSource" runat="server" AutoGenerateWhereClause="True"
            ConnectionString="name=RecruitContainer" DefaultContainerName="RecruitContainer"
            EnableDelete="True" EnableFlattening="False" EntitySetName="WorkStories" 
            EntityTypeFilter="WorkStory" Where="" Include="TDictHospitalClass"
            ContextTypeName="" EnableInsert="True" EnableUpdate="True" 
            OnInserting="gvWorkStory_EntityDataSource_Inserting" 
            OrderBy="it.StartDate asc">
            <WhereParameters>
                <asp:SessionParameter DbType="Guid" Name="PersonId" SessionField="UserId" />
            </WhereParameters>
        </asp:EntityDataSource>
        <div style="padding-top:10px">
        <asp:FormView ID="FormView1" runat="server" DefaultMode="Insert" OnPreRender="FormView1_PreRender"
            OnModeChanging="FormView1_ModeChanging" Visible="False"
            DataSourceID="gvWorkStory_EntityDataSource" DataKeyNames="Id"
            OnItemUpdated="FormView1_ItemUpdated" EnableViewState="False">
            <EditItemTemplate>
                <table>
                    <tr>
                        <td>
                            自
                        </td>
                        <td>
                            <asp:TextBox ID="tbStartDate" runat="server" Text='<%# Bind("StartDate","{0:Y}") %>'></asp:TextBox>
                            <ajaxToolkit:CalendarExtender runat="Server" ID="calStartDate" TargetControlID="tbStartDate"
                                Format="yyyy-MM" DefaultView="Years" />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="tbStartDate" CssClass="err" Text="!"></asp:RequiredFieldValidator>
                            
                        </td>
                        <td>
                            至
                        </td>
                        <td>
                            <asp:TextBox ID="tbEndDate" runat="server" Text='<%# Bind("EndDate","{0:Y}") %>'></asp:TextBox>
                            <ajaxToolkit:CalendarExtender runat="Server" ID="CalendarExtender1" TargetControlID="tbEndDate"
                                Format="yyyy-MM" DefaultView="Years" />
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="tbEndDate" CssClass="err" Text="!"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            单位名称
                        </td>
                        <td>
                            <asp:TextBox ID="tbCompany" runat="Server" Text='<%# Bind("Company") %>'></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="tbCompany" CssClass="err" Text="!"></asp:RequiredFieldValidator>
                        </td>
                        <td>
                            医院等级
                        </td>
                        <td>
                            <asp:DropDownList ID="ddHospitalClassCode" runat="server" SelectedValue='<%# Bind("HospitalClassCode") %>'
                                    DataSourceID="dsHospitalClass" DataTextField="FName" DataValueField="FHospitalClassCode">
                                </asp:DropDownList>
                                
                                <asp:SqlDataSource ID="dsHospitalClass" runat="server" ConnectionString="<%$ ConnectionStrings:RecruitLocalSqlServer %>"
                                    SelectCommand="SELECT * FROM [TDictHospitalClass]"></asp:SqlDataSource>
                        </td>
                        <tr>
                            <td>
                                岗位名称
                            </td>
                            <td>
                                <asp:TextBox ID="tbPost" runat="Server" Text='<%# Bind("Post") %>'></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="tbPost" CssClass="err" Text="!"></asp:RequiredFieldValidator>
                            </td>
                            <td>
                                聘任职称
                            </td>
                            <td>
                                <asp:TextBox ID="tbProfessionalRank" runat="Server" Text='<%# Bind("ProfessionalRank") %>'></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="tbProfessionalRank" CssClass="err" Text="!"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                    </tr>
                   
                </table>
                <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update"
                    Text="更新"></asp:LinkButton>
                <asp:LinkButton ID="CancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
                    Text="取消"></asp:LinkButton>
            </EditItemTemplate>
            <InsertItemTemplate>
                                             <table>
                    <tr>
                        <td>
                            自
                        </td>
                        <td>
                            <asp:TextBox ID="tbStartDate" runat="server" Text='<%# Bind("StartDate","{0:Y}") %>'></asp:TextBox>
                            <ajaxToolkit:CalendarExtender runat="Server" ID="calStartDate" TargetControlID="tbStartDate"
                                Format="yyyy-MM" DefaultView="Years" />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="tbStartDate" CssClass="err" Text="!"></asp:RequiredFieldValidator>
                            
                        </td>
                        <td>
                            至
                        </td>
                        <td>
                            <asp:TextBox ID="tbEndDate" runat="server" Text='<%# Bind("EndDate","{0:Y}") %>'></asp:TextBox>
                            <ajaxToolkit:CalendarExtender runat="Server" ID="CalendarExtender1" TargetControlID="tbEndDate"
                                Format="yyyy-MM" DefaultView="Years" />
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="tbEndDate" CssClass="err" Text="!"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            单位名称
                        </td>
                        <td>
                            <asp:TextBox ID="tbCompany" runat="Server" Text='<%# Bind("Company") %>'></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="tbCompany" CssClass="err" Text="!"></asp:RequiredFieldValidator>
                        </td>
                        <td>
                            医院等级
                        </td>
                        <td>
                            <asp:DropDownList ID="ddHospitalClassCode" runat="server" SelectedValue='<%# Bind("HospitalClassCode") %>'
                                    DataSourceID="dsHospitalClass" DataTextField="FName" DataValueField="FHospitalClassCode">
                                </asp:DropDownList>
                                
                                <asp:SqlDataSource ID="dsHospitalClass" runat="server" ConnectionString="<%$ ConnectionStrings:RecruitLocalSqlServer %>"
                                    SelectCommand="SELECT * FROM [TDictHospitalClass]"></asp:SqlDataSource>
                        </td>
                        <tr>
                            <td>
                                岗位名称
                            </td>
                            <td>
                                <asp:TextBox ID="tbPost" runat="Server" Text='<%# Bind("Post") %>'></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="tbPost" CssClass="err" Text="!"></asp:RequiredFieldValidator>
                            </td>
                            <td>
                                聘任职称
                            </td>
                            <td>
                                <asp:TextBox ID="tbProfessionalRank" runat="Server" Text='<%# Bind("ProfessionalRank") %>'></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="tbProfessionalRank" CssClass="err" Text="!"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                    </tr>
                   
                </table>
                <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert"
                    Text="新增"></asp:LinkButton>
                <asp:LinkButton ID="CancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
                    Text="取消"></asp:LinkButton>
            </InsertItemTemplate>
        </asp:FormView>
        </div>
        <div style="padding-top:10px">
        <asp:ValidationSummary ID="ValidationSummary1" runat="server" 
            EnableViewState="False" ForeColor="Red" HeaderText="请填写!号标识的内容" />
        </div>

    </div>
    </form>
</body>
</html>
